const privateData = new WeakMap()

class Person {
  constructor(name, age) {
    privateData.set(this, { name: name, age: age })
  }
  getName() {
    return privateData.get(this).name
  }
  getAge() {
    return privateData.get(this).age
  }
}


const ao = new Person('ao', 19)
console.log(ao.name);
// console.log(privateData.get(ao));
console.log(ao.getName());
console.log(ao.getAge());